1. Field of the Invention
The present invention relates to image processing technology, and in particular to an image processing apparatus that converts a raster image into a vector image by extracting feature points from the raster image and performing function approximation, an image processing method, and a program.
2. Description of the Related Art
In recent years, devices with different resolutions such as a display and a printing device are used in combination, and the opportunity to display one image information piece at different resolutions is increasing. If an image suitable for a low resolution device is to be displayed or printed using a high resolution device, the output size will be small as is, and thus it is necessary to convert the image so as to have an original size by interpolating pixels, for instance. Even if the image whose size has been changed in this way is output using a high resolution device, the deterioration of image quality will be noticeable since it is not possible to take advantage of the resolution of the image. For this reason, vectorization technology for converting an image represented in the raster format into an image in the vector format independent of resolution is now necessary. Vectorization technology has been studied since earlier time, and vectorization techniques as described below have been disclosed.
In Japanese Patent Laid-Open No. 2005-310070, a coordinate point sequence showing a contour of a binary image is divided at dividing points that satisfy the conditions below.
Corner point 1: a point at which a change made by a vector that connects an adjacent point sequence forms an acute angle.
Corner point 2: points at both ends in a case in which the distance between successive points is greater than a threshold value.
Inflection point: a point at which the sign of the outer product of successive vectors changes.
A tangential direction is decided with respect to each dividing point that has been obtained in this way based on the coordinate point shape in the vicinity thereof, and approximation using a Bezier curve is performed with respect to the tangential directions.
However, a method for deciding a tangential direction is not specified in Japanese Patent Laid-Open No. 2005-310070. Further, a result of the approximation is fed back, and if it is determined that the precision is low, a dividing point is added, which may cause a decrease in the processing speed and extraction of an excessive dividing point.
In Japanese Patent Laid-Open No. 04-116690, a point at which the direction of a vector is reversed in the x or y direction and a point at which a curvature is large in a continuous curved section are assumed to be dividing points with respect to a coordinate point sequence that has been input. Then, a control point is decided using, as a tangential direction, the direction of an adjacent node between the dividing points, and thereafter, the decided control point is corrected in order to adjust the tangential direction of an adjacent integrated section.
However, in Japanese Patent Laid-Open No. 04-116690, the direction of an adjacent coordinate point is uniquely decided as the tangential direction, and the approximation precision may not be high if noise is included in an approximation section.
In Japanese Patent Laid-Open No. 04-287173, the input coordinate point sequence is partitioned into segments that can be represented with a cubic curve, and least square approximation is performed. Then, tangent lines at the starting point and the terminal point of a curved line segment obtained by the least square approximation are obtained by differentiation, thereby generating a Bezier curve, and thereafter the decided tangential directions are corrected in order to connect segments.
However, in Japanese Patent Laid-Open No. 04-287173, least square approximation is necessary as preprocessing of Bezier approximation processing, which may cause a decrease in the processing speed.
As described above, with the conventional vectorization method, the approximation precision with respect to raster data serving as the basis of vector data that has been obtained and the load of vectorization processing are in a trade-off relationship with each other, and thus it has been difficult to obtain vector data with high precision by simple processing.